<div id="lecat">
<{include file="db:`$dirname`_inc_menu.html" dirname=$dirname}>

  <div class="catDetail">
    <h1><{$smarty.const._MD_LECAT_LANG_TITLE}>: <{$object->getShow('title')}>
      <a href="<{xoops_cooluri dirname=$dirname dataname=cat data_id=$object->getShow('cat_id') action=edit}>"><img src="<{$xoops_url}>/images/icons/edit.gif" alt="<{$smarty.const._EDIT}>" /></a>
      <a href="<{xoops_cooluri dirname=$dirname dataname=cat data_id=$object->getShow('cat_id') action=delete}>"><img src="<{$xoops_url}>/images/icons/delete.gif" alt="<{$smarty.const._DELETE}>" /></a>
    </h1>
    <div class="description">
      <{$object->getShow('description')}>
    </div>
    <dl class="view">
      <dt><{$smarty.const._MD_LECAT_LANG_PARENT}>:</dt>
      <dd><{if $object->mPcat}><a href="<{xoops_cooluri dirname=$dirname dataname=cat data_id=$object->getShow('p_id')}>"><{$object->mPcat->getShow('title')}></a><{else}><{$smarty.const._MD_LECAT_LANG_TOP_CAT}><{/if}></dd>
      <{if $xoops_isadmin}>
      <dt><{$smarty.const._MD_LECAT_LANG_WEIGHT}>:</dt>
      <dd><{$object->getShow('weight')}></dd>
      <dt><{$smarty.const._MD_LECAT_LANG_MODULES_CONFINEMENT}></dt>
      <{foreach item=module from=$modulesArr}>
      <dd><{$module}></dd>
      <{/foreach}>
      <{/if}>
    </dl>
  </div>
  <hr class="clear" />
  <{if $xoops_isadmin}>
  <div>
  <h2><{$smarty.const._MD_LECAT_LANG_PERMISSIONS}></h2>
  <p><{$smarty.const._MD_LECAT_TIPS_PERMISSIONS}></p>
  <form action="<{xoops_cooluri dirname=$dirname dataname=permit action=edit}>" method="post">
    <{xoops_token form=$actionFormPermit}>
    <{xoops_input type=hidden name=permit_id value=$actionFormPermit->get('permit_id')}>
    <{xoops_input type=hidden name=cat_id value=$actionFormPermit->get('cat_id')}>
    <{assign var=targetCat value=$permitObj->getTargetCat()}>
    <{if $targetCat=='cur'}>
    <table class="outer curCatPermit">
    <{elseif $targetCat=='anc'}>
    <table class="outer ancCatPermit">
    <{else}>
    <table class="outer ngCatPermit">
    <{/if}>
      <tr>
        <th style="width:150px;">Group</th>
        <{foreach item=act from=$permitObj->mActionArr.name}>
          <th><{$act}></th>
        <{/foreach}>
      </tr>
      <{foreach item=group key=gKey from=$permitObj->mGroupArr.groupid}>
        <tr>
        <{if $targetCat=='cur'}>
          <{xoops_input type=hidden name=permit_ids[$group] value=$permitObj->mPermit.permit_id[$gKey].$targetCat}>
        <{/if}>
          <th><{$permitObj->mGroupArr.name[$gKey]}></th>
          <{foreach item=permitKey key=oKey from=$permitObj->mActionArr.key}>
            <{if $targetCat}>
              <td>
              <input type="checkbox" name="permission[<{$group}>][<{$permitKey}>]" value="1"<{if $permitObj->checkPermitGroup($gKey, $oKey)==1}> checked="checked"<{/if}>>
              </td>
            <{else}>
              <td>NG</td>
            <{/if}>
          <{/foreach}>
        </tr>
      <{/foreach}>
    </table>
    <input type="submit" class="formButton" value="<{$smarty.const._SUBMIT}>"/>
  </form>
  <{assign var=catId value=$object->getShow('cat_id')}>
  <{if $permitObj->getTargetCat()=='cur'}>
    <hr />
    <form action="<{xoops_cooluri dirname=$dirname dataname=permit action=edit query="cat_id=`$catId`"}>" method="post">
    <p>
    <input type="submit" class="formButton" value="<{$smarty.const._MD_LECAT_LANG_DELEET_ALL_PERMIT}>"/>
    <{xoops_input type=hidden name=cat_id value=$object->getShow('cat_id')}>
    <{xoops_input type=hidden name=action value="PermitEdit"}>
    </p>
    </form>
  <{/if}>
  </div>
  <hr class="clear" />
  <{/if}>

  <!-- Cat Client Data -->
  <div id="clientList">
  <{foreach item=client from=$clients.data key=k}>
  <div class="client">
    <h2><{$clients.title[$k]}>
      <a href="<{xoops_cooluri dirname=$clients.dirname[$k] dataname=$clients.dataname[$k] action=list query="category_id=`$catId`"}>"><img src="<{$xoops_url}>/modules/<{$dirname}>/images/list.gif" alt="<{$smarty.const._LIST}>" /></a>
      <{if $clients.isEditor[$k]==true}><a href="<{xoops_cooluri dirname=$clients.dirname[$k] dataname=$clients.dataname[$k] action=edit query="category_id=`$catId`"}>"><img src="<{$xoops_url}>/modules/<{$dirname}>/images/add.gif" alt="<{$smarty.const._EDIT}>" /></a><{/if}>
    </h2>
    <{foreach item=item from=$clients.data[$k]}>
    <{include file="`$clients.template_name[$k]`" data=$item}>
    <{/foreach}>
  </div>
  <{/foreach}>
  </div>

  <div class="catTree">
    <h2><{$smarty.const._MD_LECAT_LANG_CAT}></h2>
    <a href="<{xoops_cooluri dirname=$dirname dataname=cat action=edit}>"><{$smarty.const._MD_LECAT_LANG_ADD_A_NEW_CAT}></a>
    <{legacy_tree tree=$childrenTree dirname=$dirname}>
  </div>
</div>
